<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>电商</title>
</head>

<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/bootstrap-theme.min.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/front.css">
<body id="product_lists">
	<div class="container">
		<include file="./Application/Home/View/header.php" />
		<br/><br/>
		<div class="row">
			<div class="col-md-3">
				<div id="product_menu">
					<div id="product_menu_title"><?=$parent_catalog['name']?></div>
					<ul>
						<?php foreach($brother_catalogs as $c){?>
						<li <?php if($c['id'] == $catalog['id']){?> class="active" <?php }?>><a href="<?= U('home/product/lists/cataid/'.$c['id'])?>"><?=$c['name']?></a></li>
						<?php }?>
					</ul>
				</div>
			</div>
			<div class="col-md-9">
				<div class="row">
					<div class="col-md-12">
						<?php
							foreach($brands as $b){?>
							<a href="<?php echo U()."?brand=".$b->id?>"><?=$b->name?></a>
						<?php }?>
					</div>
				</div>
					
					<div class="row">
						<?php foreach($products as $p){?>
						<div class="col-md-3 product_item">
							<img style="height:100px;" class="product_item_img" src="__ROOT__<?=$p['img']?>">
							<?php $imgs = M('product_img')->where('product_id='.$p['id'])->limit(4)->select();?>
							<ul class="clearfix">
								<?php foreach($imgs as $img){?>
								<li><img style="height:100px;" src="__ROOT__<?=$img['url']?>"/></li>
								<?php }?>
							</ul>
							<h5><?=$p['title']?></h5>
							<p class="price">￥<?=$p['price']?></p>
							<a href="<?=U('home/product/detail/id/'.$p->id)?>" class="btn btn-danger">立即购买</a>
						</div>
						<?php }?>
					</div>

				</div>
			</div>
		</div>
				<script type="text/javascript" src="__PUBLIC__/js/jquery.js"></script>
				<script type="text/javascript">
				    $(function() {
				    	$('.product_item ul li').mouseover(function(){
				    		$(this).parents('.product_item').find('ul li').removeClass("hover");
				    		$(this).addClass('hover');
				    		var src  = $(this).find('img').attr('src');
				    		$(this).parents('.product_item').find('.product_item_img').attr('src',src);
				    		
				    	})
				    })
				</script>
	
</body>
</html>	




